//引入数据库操作方法
var dbserver = require('./dbserver.js');
const packInfo = require("./packInfo.js")

module.exports = function(app){
	for (let t in packInfo.crud) {
		for (let i in packInfo.crud[t])
		app.post(`/${packInfo.crud[t][i].name}`,(req,res) => {
			console.log(`${packInfo.crud[t][i].name}`)
			dbserver[packInfo.crud[t][i].name](req.body.data,res)
		})
	}
}